package com.ego.controller;

import com.ego.pojo.EasyUITree;
import com.ego.pojo.EgoResult;
import com.ego.service.ItemCatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
public class ItemCatController {

    @Autowired
    private ItemCatService itemCatService;

    @RequestMapping("/item/cat/list")
    @ResponseBody
    public List<EasyUITree> showItemCat(@RequestParam(value = "id", defaultValue = "0") Long id) {
        return itemCatService.selectItemCat(id);
    }

    @RequestMapping("/cat/param/query/id/{id}")
    @ResponseBody
    public EgoResult selectItemParamById(@PathVariable long id) {
        return itemCatService.selectItemCatById(id);
    }

}
